﻿@{
    ViewBag.Title = "SetAdd";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@model YJ.Data.Model.HomeItems
<form id="form1" method="post">
    <table cellpadding="0" cellspacing="1" border="0" width="95%" class="formtable" style="margin-top:10px;">
        <tr>
            <th style="width: 80px;">模块名称：</th>
            <td><input type="text" class="mytext" validate="empty" id="Name1" name="Name1" value="@Model.Name" style="width:300px;" /></td>
        </tr>
        <tr>
            <th style="width: 80px;">显示标题：</th>
            <td><input type="text" class="mytext" validate="empty" id="Title1" name="Title1" value="@Model.Title" style="width:300px;" /></td>
        </tr>
        <tr>
            <th style="width: 80px;">类型：</th>
            <td><select id="Type" name="Type" class="myselect">
                <option></option>
                @Html.Raw(ViewBag.TypeOptions)
                </select></td>
        </tr>
        <tr>
            <th style="width: 80px;">数据来源：</th>
            <td><select id="DataSourceType" name="DataSourceType" onchange="dstypecng(this.value);" class="myselect" validate="empty">
                <option></option>
                @Html.Raw(ViewBag.DataSourceTypeOptions)
                </select>
                <span id="DBConnIDSpan" style="display:none;">
                    数据连接：
                    <select class="myselect" id="DBConnID" name="DBConnID">
                        <option></option>
                        @Html.Raw(ViewBag.DBConnIDOptions)
                    </select>
                </span>
            </td>
        </tr>
        <tr>
            <th style="width: 80px;">来源：</th>
            <td><textarea class="mytextarea" validate="empty" style="width:99%;height:160px;" name="DataSource" id="DataSource">@Model.DataSource</textarea></td>
        </tr>
        <tr>
            <th style="width: 80px;">连接地址：</th>
            <td><input type="text" class="mytext" id="LinkURL" name="LinkURL" style="width:99%;" value="@Model.LinkURL"/></td>
        </tr>
        <tr>
            <th style="width: 80px;">图标：</th>
            <td><input type="text" class="myico" source="/Images/ico" id="Ico" name="Ico" value="@Model.Ico" style="width:300px;" /></td>
        </tr>
        <tr>
            <th style="width: 80px;">背景颜色：</th>
            <td><input type="text" class="mytext" id="BgColor" name="BgColor" style="width:300px;" value="@Model.BgColor"/></td>
        </tr>
       
        <tr>
            <th style="width: 80px;">使用对象：</th>
            <td><input type="text" class="mymember" id="UseOrganizes" name="UseOrganizes" style="width:90%;" value="@Model.UseOrganizes" /></td>
        </tr>
        
        <tr>
            <th style="width: 80px;">备注：</th>
            <td><input type="text" class="mytext" id="Note" name="Note" style="width:99%;" value="@Model.Note" /></td>
        </tr>
        <tr>
            <th style="width: 80px;">排序：</th>
            <td><input type="text" class="mytext" id="Sort" name="Sort" style="" value="@Model.Sort" /></td>
        </tr>
    </table>
    <div class="buttondiv">
        <input type="submit" class="mybutton" value=" 保 存 " onclick="return new RoadUI.Validate().validateForm(document.forms[0]);" />
        <input type="button" class="mybutton" value=" 返 回 " onclick="window.location='SetList@(Request.Url.Query)'" />
    </div>
    </form>
    <script type="text/javascript">
        $(function(){
            @Html.Raw(ViewBag.script)
            dstypecng($("#DataSourceType").val());
        });
        function dstypecng(type)
        {
            if("0"==type)
            {
                $("#DBConnIDSpan").show();
            }
            else
            {
                $("#DBConnIDSpan").hide();
            }
        }
    </script>
